package com.huangpuweb.api.model;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class SanitationInfoRowMapper implements RowMapper<SanitationInfo> {
    @Override
    public SanitationInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
        SanitationInfo sa = new SanitationInfo();
        sa.setAid(rs.getString("aid"));
        sa.setName(rs.getString("name"));
        sa.setType(rs.getString("type"));
        sa.setStreet(rs.getString("street"));
        sa.setSid(rs.getString("sid"));
        sa.setAddress(rs.getString("address"));
        sa.setContacinfo(rs.getString("contacinfo"));
        sa.setContacter(rs.getString("contacter"));
        sa.setDangerinfo(rs.getString("dangerinfo"));
        sa.setCoordinates(rs.getString("coordinates"));
        sa.setDid(rs.getString("did"));
        sa.setLat(rs.getString("lat"));
        sa.setLng(rs.getString("lng"));
        return sa;
    }
}
